The storage subsystem is one of the slowest subsystems of a computer system, especially when the storage subsystem utilizes a storage medium such as a hard-disk drive (HDD). A HDD requires relatively long access time as the read/write heads need to be moved mechanically to a particular location on the platters of the HDD in order to read/write data.
To improve the performance of the HDD, a non-volatile cache memory can be used to hold the results of recent reads from the HDD and writes to the HDD. By caching the data of the HDD, the performance of the computer system can be increased, and the HDD can remain spun down for longer durations to reduce power consumption of the computer system.
However, if the power to the computer system is unexpectedly shut off, the data in the non-volatile cache memory must be associated back with the HDD in order to prevent data corruption. Dedicated caching hardware that supports atomic metadata writes with the cache data writes can be utilized to ensure that this recovery is done correctly, but it increases the cost of the computer system.